package com.kun.portal.webframe.controller;


import com.kun.portal.webframe.po.ContractManagePo;
import com.kun.portal.webframe.service.ContractManageService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


import java.util.List;

/**
 * Created by Administrator on 2018/5/16.
 */
@Controller

@RequestMapping({"/api/sysSetting"})
public class ContractManageController {
    @Autowired
    private ContractManageService contractManageService;


    @RequestMapping(
            value = {"/findContractManage"},
           method = {RequestMethod.GET},
           produces = {"application/json"}
   )
    @ResponseBody
 public List findAllContractManage(){
        return contractManageService.findAllContractManagePo();
    }


    @RequestMapping(
            value = {"/saveContractManage"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void saveContractManagePo(@RequestBody ContractManagePo contractManagePo){
        contractManageService.saveContractManagePo(contractManagePo);
    }

    @RequestMapping(
            value = {"/delectContractManage"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void deleteContractManagePo(@RequestBody ContractManagePo contractManagePo){
        contractManageService.deleteContractManagePo(contractManagePo);
    }
    @RequestMapping(
            value = {"/checkContractManage"},
            method = {RequestMethod.GET},
            produces = {"application/json"}
    )
    @ResponseBody
    public  List<ContractManagePo> checkContractManagePo(@RequestParam(required = false) String contractNumber ,
                                                         @RequestParam(required = false) String contractAgreemen ){
            return contractManageService.checkContractManagePo(contractNumber,contractAgreemen);
        }


}
